package com.ws.common.util;

/**
 * Created by WS on 2018/1/26.
 */
public interface ResultCode {
    String getCode();

    String getMsg();

    String getMsg(String code);

    enum Common implements ResultCode{
        SUCCESS("000000","成功"),
        UNAUTHORIZE("401","未授权访问"),
        LOGIN_TIMEOUT("00001","登录超时"),
        RUNTIME_EXCEPTION("100001","运行时异常");

        private String code;

        private String msg;

        Common(String code, String msg) {
            this.code = code;
            this.msg = msg;
        }

        @Override
        public String getCode() {
            return code;
        }

        @Override
        public String getMsg() {
            return msg;
        }

        @Override
        public String getMsg(String code) {
            return msg;
        }
    }
}
